I'm using this code to handle new tab and getting this error. It's displaying chrome-error //chromewebdata/ in url.
Tried for few other example site and it's working fine. I think mine url is redirecting two times that why facing this issue "redirected too many time". How I can handle it?
cy.get(".store-list-item__action").contains("a","Log in").eq(0).invoke("removeAttr", 'target').then(newUrl=>{
cy.wrap(newUrl).click()
})
How about you just use this:
cy.contains('a', 'Log in').invoke("removeAttr", 'target').click()
.invoke("removeAttr", 'target')
Above Command will work only if system is moving user to same "href" link, in this case after clicking the link systemis redirecting user to another page/link which cypress doesn't support. So cy.request() method can be used for this scenario to validate data.